#include "../../util/fd_util_base.h"
#include "fd_hashes.h"
#include "../../ballet/lthash/fd_lthash.h"
#include "../types/fd_types.h"
#include <string.h>
#include <stdio.h>

/* Helper function to check if two hashes are equal */
static int
fd_lthash_equal( fd_lthash_value_t const * a, fd_lthash_value_t const * b ) {
  return memcmp( a->bytes, b->bytes, FD_LTHASH_LEN_BYTES ) == 0;
}

static int
fd_hash_equal( fd_hash_t const * a, fd_hash_t const * b ) {
  return memcmp( a->uc, b->uc, FD_HASH_FOOTPRINT ) == 0;
}

static void
test_fd_hashes_account_lthash( void ) {
  FD_LOG_NOTICE(( "Testing fd_hashes_account_lthash" ));

  /* Test case 1: Zero lamports account should produce zero hash */
  {
    fd_pubkey_t pubkey;
    memset( &pubkey, 0x42, sizeof(fd_pubkey_t) );

    fd_account_meta_t account;
    account.lamports = 0UL;
    account.executable = 1;
    memcpy( account.owner, pubkey.key, FD_PUBKEY_FOOTPRINT );
    account.dlen = 100UL;

    uchar data[100];
    memset( data, 0x55, 100 );

    fd_lthash_value_t lthash_out;
    fd_hashes_account_lthash( &pubkey, &account, data, &lthash_out );

    /* Expected hash for zero lamports is all zeros */
    fd_lthash_value_t expected_hash;
    fd_lthash_zero( &expected_hash );

    if( !fd_lthash_equal( &lthash_out, &expected_hash ) ) {
      FD_LOG_ERR(( "Test case 1 failed: hash mismatch" ));
    }
    FD_TEST( fd_lthash_equal( &lthash_out, &expected_hash ) );
  }

  /* Test case 2: Non-zero lamports with executable=0 */
  {
    fd_pubkey_t pubkey;
    memset( &pubkey, 0x11, sizeof(fd_pubkey_t) );

    fd_account_meta_t account;
    account.lamports = 1000UL;
    account.executable = 0;
    memset( account.owner, 0x22, FD_PUBKEY_FOOTPRINT );
    account.dlen = 50UL;

    uchar data[50];
    memset( data, 0x33, 50 );

    fd_lthash_value_t lthash_out;
    fd_hashes_account_lthash( &pubkey, &account, data, &lthash_out );

    /* Expected hash value for test case 2 */
    fd_lthash_value_t expected_hash = { .bytes = {
      0x3c, 0x81, 0xe2, 0xef, 0x74, 0x5e, 0x3f, 0x80, 0x38, 0xd4, 0x01, 0x6a, 0x51, 0x3e, 0x47, 0x5a,
    0xcb, 0x62, 0x5e, 0x12, 0x9d, 0x67, 0x8f, 0x96, 0xc9, 0xa9, 0x84, 0x4d, 0x7b, 0xac, 0x41, 0xbd,
    0x22, 0x58, 0xbe, 0xa4, 0x88, 0x15, 0xa8, 0x52, 0xf3, 0x3e, 0x61, 0x4a, 0x55, 0x25, 0x57, 0x04,
    0x2b, 0xfa, 0xaa, 0xe0, 0xa8, 0xa5, 0xfc, 0xe7, 0xd1, 0x1d, 0xe1, 0x20, 0x8e, 0x0d, 0x17, 0xaf,
    0x57, 0xb1, 0x4e, 0x6b, 0x25, 0xb0, 0xfd, 0x95, 0x1d, 0x5a, 0x8d, 0x91, 0xec, 0x37, 0x7f, 0x0a,
    0xdc, 0xac, 0x56, 0x8f, 0x5c, 0x95, 0x30, 0xc2, 0x91, 0xe5, 0xdd, 0xd3, 0x6b, 0x6b, 0x5e, 0x61,
    0x60, 0x67, 0xf8, 0xbb, 0xa5, 0xa6, 0xab, 0xf4, 0xfa, 0x36, 0xa5, 0x3e, 0x48, 0x67, 0x55, 0x41,
    0x72, 0x28, 0x86, 0x9e, 0x4c, 0xdd, 0x49, 0x91, 0x65, 0xb5, 0x45, 0xa5, 0x5b, 0xba, 0xd1, 0xb7,
    0x79, 0x7b, 0xda, 0xce, 0xd2, 0x95, 0xc1, 0x99, 0x87, 0x56, 0x9b, 0x23, 0x45, 0xa7, 0x25, 0x97,
    0x37, 0x62, 0xc5, 0x52, 0x33, 0x72, 0xa8, 0x9d, 0x23, 0x17, 0xff, 0xfb, 0x21, 0x60, 0xe6, 0xa0,
    0xb9, 0xf7, 0x7d, 0x1d, 0x6c, 0x4f, 0x5a, 0x8a, 0xe2, 0x21, 0x7a, 0x99, 0xd8, 0x67, 0xc8, 0x7d,
    0x8e, 0x60, 0xec, 0x25, 0xfa, 0x01, 0x07, 0x91, 0xb8, 0xf8, 0x48, 0x9f, 0x9c, 0x70, 0x86, 0x1e,
    0x5c, 0xb7, 0x8c, 0x51, 0xeb, 0x25, 0x6d, 0x25, 0x5b, 0xfa, 0xd3, 0x29, 0x05, 0x33, 0x8d, 0x8d,
    0x7a, 0x46, 0xc4, 0xa2, 0x1f, 0x0b, 0xf0, 0xa2, 0xda, 0xb2, 0x3c, 0x93, 0xf3, 0xe7, 0x87, 0xc6,
    0x24, 0xf2, 0xc6, 0xe5, 0x93, 0x64, 0x4a, 0x0f, 0x87, 0x59, 0x18, 0x67, 0xe0, 0x59, 0xce, 0x57,
    0xd9, 0x2e, 0x39, 0xe2, 0x7e, 0x36, 0xe2, 0xf1, 0xe7, 0xbf, 0xff, 0xe4, 0xea, 0x8f, 0xf9, 0xcd,
    0x7d, 0x8b, 0xae, 0x75, 0xd4, 0xfa, 0x84, 0x57, 0xdf, 0x4e, 0xd6, 0xf1, 0x88, 0x72, 0x07, 0x7d,
    0xad, 0xbf, 0xed, 0x26, 0xc5, 0x4d, 0xef, 0xba, 0x00, 0xf5, 0xff, 0xde, 0xd5, 0x18, 0xbe, 0xb6,
    0x36, 0xd3, 0xa4, 0x3b, 0x49, 0xb3, 0xd2, 0x98, 0x29, 0xab, 0xfa, 0x6a, 0x02, 0x18, 0xed, 0xeb,
    0xbf, 0xb8, 0x9f, 0xf3, 0x0e, 0x69, 0x07, 0x48, 0x44, 0x94, 0x89, 0x57, 0xfb, 0x33, 0x8e, 0xb4,
    0xa6, 0xdd, 0x1f, 0x6a, 0x9b, 0x4e, 0x80, 0x2d, 0x96, 0x32, 0xa7, 0x8b, 0x6c, 0xf0, 0x2f, 0xf3,
    0xae, 0xff, 0xfd, 0x70, 0xcb, 0x2d, 0x5e, 0x73, 0xce, 0xc2, 0x72, 0x04, 0xf1, 0x95, 0x80, 0x75,
    0x32, 0xee, 0x77, 0xf2, 0xc5, 0x33, 0x7e, 0x91, 0xc8, 0xfd, 0xfc, 0x20, 0x4a, 0xcd, 0x84, 0x37,
    0x6e, 0x8c, 0x9a, 0x2e, 0x54, 0x8d, 0x2a, 0x38, 0x1a, 0x28, 0x13, 0x08, 0xb9, 0x97, 0xfc, 0x66,
    0x03, 0x6b, 0xa4, 0x0f, 0xb4, 0x47, 0x8c, 0xfd, 0x46, 0x3f, 0x8e, 0x2a, 0xdd, 0x69, 0x76, 0xad,
    0x40, 0x29, 0x80, 0x46, 0x88, 0xc8, 0xb3, 0x07, 0xa8, 0x65, 0x9c, 0x51, 0xec, 0x5d, 0x14, 0xc8,
    0x34, 0x45, 0x69, 0x91, 0xc2, 0xa9, 0x12, 0x2b, 0x39, 0x9e, 0xd6, 0x61, 0x2f, 0x1c, 0x9f, 0xb1,
    0x72, 0x39, 0xed, 0x5f, 0x01, 0xc6, 0xcd, 0xd8, 0xbe, 0x28, 0xd9, 0x3e, 0x9f, 0x7b, 0x63, 0x88,
    0xba, 0x95, 0x39, 0x7b, 0xb1, 0x33, 0xf8, 0x91, 0x1c, 0x0f, 0x49, 0x8e, 0xde, 0x3c, 0x3b, 0x62,
    0x5e, 0x1d, 0xc4, 0x76, 0x7f, 0x3e, 0xe2, 0x87, 0x6c, 0xc5, 0x67, 0x84, 0x8d, 0x8f, 0x5b, 0x75,
    0xba, 0xdf, 0xdf, 0x1a, 0xb5, 0xb4, 0xc8, 0xcd, 0x53, 0x8a, 0xa2, 0xb2, 0xe6, 0x72, 0xdc, 0x35,
    0xd3, 0x98, 0x9a, 0xd8, 0xe0, 0x0b, 0x72, 0xdd, 0x03, 0x8a, 0xbd, 0xaa, 0x8c, 0x51, 0x2d, 0xa6,
    0x87, 0xab, 0x56, 0xc6, 0xe2, 0x5c, 0x68, 0x4e, 0xf2, 0xbc, 0xa9, 0x94, 0x7e, 0x7f, 0xe4, 0x7e,
    0x70, 0x70, 0xbe, 0xa2, 0x72, 0x82, 0x9e, 0x57, 0xc3, 0x7e, 0xe4, 0x07, 0x8a, 0x4f, 0xaa, 0x20,
    0xe7, 0x29, 0xf1, 0x88, 0xff, 0x2d, 0xa8, 0xaa, 0x7f, 0x2d, 0x8d, 0x3b, 0x11, 0xd2, 0xf0, 0x7d,
    0x74, 0x90, 0xe5, 0x1d, 0x0d, 0x88, 0x08, 0x72, 0xaf, 0x9d, 0x84, 0x03, 0x1d, 0x63, 0x36, 0xfa,
    0xa7, 0x4e, 0x2e, 0x37, 0xef, 0xa4, 0xd5, 0x12, 0xe0, 0x9e, 0x95, 0x95, 0x9d, 0xa1, 0x5c, 0xec,
    0xc8, 0x83, 0x9b, 0xcf, 0x51, 0x2c, 0x25, 0x64, 0x7a, 0xbe, 0x34, 0x89, 0x9c, 0xe1, 0x4a, 0xc2,
    0x0a, 0xed, 0xdb, 0xdf, 0x23, 0x0c, 0xe4, 0xd5, 0x69, 0xee, 0xfa, 0xc3, 0xc4, 0x50, 0x32, 0x9f,
    0x83, 0x9a, 0xe8, 0xb9, 0xac, 0xe2, 0x22, 0x16, 0x50, 0x3e, 0x27, 0xa3, 0x9d, 0xf2, 0xf8, 0x34,
    0xd8, 0x92, 0xd2, 0x0a, 0xdb, 0xa8, 0xde, 0x1e, 0x54, 0x4b, 0x7e, 0xb4, 0x90, 0x2f, 0x00, 0x0c,
    0x4a, 0xc2, 0x3a, 0xe0, 0xdc, 0x87, 0xc4, 0x67, 0x2c, 0x30, 0x85, 0x1f, 0x6a, 0xa3, 0x53, 0x60,
    0x9d, 0xfd, 0x2c, 0x94, 0x57, 0x4f, 0x5e, 0x88, 0x65, 0x08, 0x6f, 0xaa, 0x28, 0x24, 0x3f, 0x05,
    0x71, 0x1b, 0x79, 0x6a, 0x5c, 0xb6, 0xc5, 0x1f, 0x18, 0xe2, 0xd0, 0x98, 0x8d, 0xe3, 0x59, 0x45,
    0x25, 0x08, 0xec, 0xbe, 0x66, 0x22, 0x57, 0x75, 0x09, 0x58, 0x04, 0x4b, 0xe1, 0x22, 0xc5, 0x40,
    0xea, 0xe9, 0x85, 0xe2, 0xbd, 0x25, 0x23, 0xcb, 0x62, 0xd7, 0x23, 0x27, 0x93, 0xc1, 0xb9, 0xf7,
    0xc5, 0x8c, 0x2f, 0x82, 0xbc, 0x71, 0xdb, 0xd6, 0x2f, 0xb3, 0xae, 0x55, 0xed, 0xd6, 0x4d, 0x0c,
    0x35, 0x05, 0x72, 0x1d, 0xbd, 0xa1, 0xc6, 0x9f, 0xf2, 0xa7, 0xfd, 0x5a, 0x66, 0x64, 0xe7, 0x88,
    0x35, 0xaf, 0x84, 0x05, 0x13, 0x67, 0xb6, 0x6b, 0xf0, 0xa6, 0x29, 0x58, 0x00, 0xc9, 0x34, 0xbb,
    0x0b, 0x03, 0xaf, 0xdf, 0xd3, 0xf1, 0x79, 0x14, 0xeb, 0x78, 0x66, 0xff, 0xfd, 0x5f, 0xb5, 0xac,
    0xec, 0x96, 0xad, 0x91, 0x25, 0x12, 0x13, 0xa8, 0xbc, 0xcc, 0x66, 0x11, 0x83, 0x1d, 0xb2, 0x3d,
    0x49, 0x34, 0xbf, 0xd1, 0x52, 0x86, 0xd8, 0x35, 0x48, 0x6f, 0x3e, 0xdf, 0xfb, 0x0b, 0xbc, 0x7c,
    0xc6, 0x28, 0x8f, 0xa6, 0xfc, 0xac, 0xab, 0x0f, 0x91, 0x41, 0xe4, 0x08, 0xfe, 0x7b, 0xc3, 0x75,
    0x0a, 0xf5, 0xac, 0x5e, 0xb0, 0x8e, 0x1c, 0xd8, 0xbe, 0xeb, 0x37, 0x60, 0xba, 0x9c, 0x6c, 0x36,
    0xf0, 0x6c, 0xf6, 0x21, 0x07, 0xfc, 0x22, 0x6a, 0x33, 0x30, 0x6d, 0x89, 0x10, 0x98, 0xb0, 0x44,
    0x88, 0x0c, 0x74, 0xf8, 0xf7, 0xc3, 0xf0, 0x26, 0xd2, 0x90, 0x16, 0x83, 0x93, 0xcd, 0x45, 0x27,
    0x90, 0x29, 0x42, 0x5c, 0x4c, 0x23, 0xf0, 0xb8, 0x1d, 0x8e, 0x1b, 0xa6, 0xa7, 0xc6, 0x9a, 0x07,
    0xd5, 0x21, 0x7d, 0x78, 0x70, 0x8b, 0x0c, 0xa7, 0x22, 0x89, 0x3c, 0x48, 0x8b, 0x97, 0x99, 0x5e,
    0xa3, 0xb3, 0xce, 0xc1, 0xdb, 0x2a, 0xea, 0x5b, 0xed, 0xe6, 0x81, 0xb6, 0xd7, 0xe6, 0x2e, 0x6a,
    0xf4, 0x55, 0xcc, 0x2d, 0x44, 0x12, 0x74, 0x27, 0xfd, 0xa4, 0x34, 0x79, 0x5a, 0x3e, 0x0d, 0xd3,
    0x53, 0xb5, 0xe9, 0x89, 0x73, 0xaf, 0x10, 0x3e, 0x78, 0x71, 0x22, 0x88, 0x2a, 0x4c, 0x07, 0xca,
    0x60, 0x13, 0x2b, 0xec, 0xf0, 0xc6, 0x7e, 0x99, 0xc4, 0xa3, 0xc2, 0x62, 0x35, 0x85, 0x44, 0x54,
    0x97, 0xba, 0x2a, 0x0b, 0x6b, 0x1b, 0x44, 0x6c, 0xc7, 0xf0, 0xdc, 0x50, 0x7f, 0xce, 0x3b, 0xbd,
    0x23, 0x80, 0xeb, 0xe6, 0x79, 0x38, 0xf3, 0x7a, 0xbb, 0xe9, 0x6f, 0xca, 0x83, 0xd0, 0x41, 0x40,
    0xd3, 0xd6, 0x1a, 0x9e, 0xfe, 0xbc, 0x01, 0x3a, 0x36, 0x3d, 0x9f, 0xe4, 0x01, 0xe0, 0xa8, 0x17,
    0x5f, 0x6d, 0xaf, 0xf8, 0x88, 0xea, 0xb7, 0xc7, 0xa2, 0x74, 0x2d, 0x02, 0x9e, 0x03, 0x24, 0x16,
    0xf5, 0xe0, 0xbd, 0xff, 0x40, 0x65, 0x61, 0xa3, 0x7e, 0x5f, 0x50, 0x87, 0x53, 0xef, 0x0b, 0x77,
    0xaf, 0x7f, 0xd8, 0x88, 0xd2, 0xb0, 0xe3, 0x3c, 0x73, 0x8e, 0xff, 0xd0, 0x2d, 0xf0, 0xac, 0xbd,
    0x94, 0xa4, 0xe6, 0x8b, 0xf2, 0x0f, 0x61, 0xff, 0xda, 0xab, 0x9e, 0x3b, 0xef, 0x48, 0x41, 0xb3,
    0xc6, 0xda, 0x6d, 0x34, 0xa1, 0x35, 0x07, 0x7b, 0x3a, 0x1c, 0x6e, 0x5a, 0x30, 0x57, 0x29, 0x72,
    0x5c, 0x77, 0xc9, 0x15, 0xe6, 0xb1, 0x3e, 0x73, 0xa0, 0x5d, 0x3b, 0x70, 0xe0, 0xe2, 0xa6, 0xe3,
    0x6c, 0xa9, 0x6e, 0x73, 0x29, 0xf3, 0x25, 0x04, 0xe5, 0xa1, 0x57, 0xad, 0xc4, 0x23, 0x0e, 0xd7,
    0xc1, 0x71, 0x03, 0x84, 0x04, 0x9b, 0xeb, 0xf4, 0x3a, 0xcc, 0x7c, 0x53, 0xb4, 0x2d, 0xb1, 0xf1,
    0x97, 0x87, 0xe0, 0x29, 0x8a, 0x42, 0x3a, 0x47, 0x71, 0x05, 0x09, 0xde, 0x74, 0xd7, 0xd7, 0x6c,
    0x44, 0x38, 0x14, 0xf9, 0xf5, 0x61, 0xac, 0xcc, 0xb8, 0xf8, 0x50, 0x00, 0x3e, 0x29, 0xc0, 0x32,
    0x6a, 0xc8, 0x92, 0x17, 0x98, 0xe8, 0x07, 0xa8, 0x82, 0x9e, 0x5a, 0x55, 0x97, 0xef, 0x6e, 0x07,
    0x67, 0x93, 0x75, 0x4a, 0x15, 0xb4, 0x5f, 0xd3, 0xd3, 0xe5, 0xae, 0x10, 0xc3, 0x81, 0xb0, 0xad,
    0x23, 0xb6, 0x89, 0x80, 0x8f, 0x16, 0xc6, 0xb1, 0x2e, 0xd6, 0x4b, 0xf8, 0x4a, 0x3f, 0xc9, 0xab,
    0x64, 0x3e, 0xa6, 0xc3, 0x57, 0x2a, 0x05, 0xd6, 0x4a, 0xd6, 0xb8, 0x6f, 0x62, 0x14, 0x6b, 0x4c,
    0xcb, 0xa8, 0x0e, 0x4c, 0x10, 0x49, 0xce, 0x80, 0x0b, 0x25, 0x06, 0xb2, 0xa5, 0x68, 0x88, 0x8c,
    0x69, 0x7b, 0xbb, 0x7d, 0x9f, 0xad, 0x17, 0x09, 0x73, 0xf0, 0xcf, 0x12, 0xb1, 0xd9, 0x57, 0xa3,
    0x66, 0x96, 0xd6, 0x59, 0x42, 0x64, 0xf1, 0xe2, 0xd3, 0xfd, 0x6f, 0x86, 0xac, 0x95, 0xff, 0xa8,
    0xe0, 0x32, 0xe8, 0xfc, 0xd6, 0x00, 0x0b, 0xd9, 0xf7, 0xe8, 0xb2, 0x53, 0x6b, 0x4b, 0xf8, 0x4d,
    0x1b, 0x2d, 0x5a, 0x75, 0x73, 0x39, 0x86, 0x6b, 0xae, 0x80, 0x03, 0x57, 0x33, 0x08, 0xe1, 0x4c,
    0xcf, 0xd8, 0xf9, 0xd0, 0x1c, 0xc4, 0xce, 0xda, 0xd0, 0x8d, 0xd6, 0x33, 0x1f, 0x0c, 0xe3, 0x59,
    0xe1, 0x86, 0x37, 0x3e, 0xb5, 0x4e, 0x8d, 0xae, 0x32, 0xd9, 0x2f, 0xf2, 0x93, 0xf2, 0xc3, 0x58,
    0xea, 0xd6, 0xf9, 0x18, 0xe0, 0xe1, 0xb2, 0x15, 0x15, 0xcc, 0xea, 0xa0, 0xc1, 0xf1, 0x3c, 0x74,
    0x9d, 0x9b, 0x44, 0x06, 0x88, 0xe5, 0x74, 0xac, 0xbd, 0x17, 0x63, 0x4f, 0xab, 0xed, 0x3e, 0x91,
    0x24, 0x1e, 0x01, 0x9d, 0xe4, 0x93, 0x9c, 0x4d, 0x53, 0xcb, 0x86, 0x11, 0x0b, 0x8a, 0x1b, 0xf9,
    0x1d, 0xfc, 0x29, 0x52, 0x72, 0xd6, 0xb2, 0x3a, 0x5e, 0xad, 0xca, 0x85, 0x5d, 0x95, 0x14, 0x5b,
    0x9d, 0x04, 0x46, 0x75, 0xad, 0xc4, 0x4b, 0xf4, 0xc9, 0xc8, 0x84, 0x58, 0xa1, 0xe3, 0x70, 0x31,
    0x78, 0xdd, 0xf5, 0x6e, 0x58, 0x09, 0xba, 0x74, 0x79, 0x64, 0x2e, 0xaa, 0xe3, 0xff, 0xaf, 0x5d,
    0x42, 0x83, 0xc5, 0xf9, 0x63, 0x83, 0x46, 0xc0, 0xf6, 0xb5, 0x0c, 0xa1, 0x63, 0x83, 0xb0, 0xa7,
    0xfe, 0x98, 0xf5, 0x23, 0x37, 0x10, 0x44, 0x35, 0x72, 0x9a, 0x65, 0x72, 0x5c, 0xf4, 0xa6, 0x55,
    0xa7, 0xfe, 0x5e, 0xdd, 0x12, 0x41, 0xd0, 0x9c, 0x24, 0x36, 0x8b, 0xe7, 0x3e, 0x85, 0xef, 0xf4,
    0xe9, 0x93, 0x0a, 0xee, 0x91, 0x24, 0x0d, 0x15, 0x5c, 0xf1, 0x30, 0xea, 0x60, 0x44, 0xa9, 0xb2,
    0x71, 0x81, 0xe3, 0x58, 0xa4, 0xae, 0x71, 0x6f, 0xce, 0x8a, 0xdf, 0xd8, 0x36, 0x51, 0x3c, 0x8e,
    0x10, 0xeb, 0xda, 0xd5, 0x26, 0xab, 0x49, 0x90, 0xad, 0xfd, 0x17, 0xb2, 0x52, 0x22, 0x45, 0xc0,
    0x3f, 0xe1, 0xb5, 0x1e, 0xc9, 0x1e, 0x3d, 0xb9, 0xe1, 0x90, 0xd0, 0x66, 0x01, 0x4c, 0x2f, 0x82,
    0xc4, 0x17, 0x94, 0x20, 0xc7, 0x43, 0x76, 0x4d, 0x88, 0x90, 0x04, 0x6d, 0xf2, 0xd9, 0x8d, 0x2a,
    0x9a, 0x31, 0xc4, 0x3f, 0x23, 0xfd, 0xee, 0xee, 0x22, 0x49, 0xa1, 0xa0, 0x5f, 0x49, 0x73, 0x64,
    0x32, 0xd0, 0x76, 0x23, 0xb3, 0x0b, 0x69, 0xb5, 0x95, 0xfd, 0xb4, 0xfc, 0x57, 0xa5, 0x0b, 0x97,
    0xea, 0x67, 0x66, 0xc5, 0x51, 0x27, 0x5c, 0xb7, 0x43, 0x93, 0x7e, 0x20, 0x0b, 0xa6, 0x74, 0x40,
    0x6b, 0x8d, 0x43, 0x96, 0x23, 0xd1, 0x07, 0x93, 0x32, 0x33, 0x37, 0x2e, 0xf5, 0xe4, 0xa7, 0x19,
    0x79, 0xb8, 0x26, 0x2c, 0x58, 0x68, 0x63, 0x31, 0x55, 0x14, 0x38, 0x3e, 0x75, 0x5c, 0x93, 0xef,
    0x73, 0x6e, 0x4b, 0x08, 0xcd, 0x01, 0xdc, 0x74, 0x2f, 0x5f, 0x04, 0xd4, 0x0c, 0xba, 0x98, 0xc7,
    0xb9, 0x4a, 0x47, 0x9e, 0x08, 0xd2, 0x47, 0xa1, 0xa0, 0xf8, 0xfa, 0x20, 0x7f, 0x3e, 0x03, 0x41,
    0x48, 0x17, 0x14, 0x04, 0x22, 0x7e, 0x98, 0x70, 0x7a, 0xe3, 0x56, 0x4d, 0xed, 0x54, 0xab, 0x6c,
    0xda, 0xa4, 0x51, 0xc3, 0x16, 0x30, 0xa4, 0xd2, 0x0c, 0x2d, 0x0c, 0xbb, 0x2e, 0x2d, 0xfb, 0x75,
    0x32, 0x67, 0x1b, 0x01, 0x3f, 0x4b, 0xd8, 0x65, 0x74, 0x50, 0x4d, 0xcf, 0x66, 0xdf, 0x0e, 0x59,
    0x10, 0x15, 0x28, 0x9b, 0x7d, 0x2d, 0xef, 0x97, 0x67, 0x7a, 0x7b, 0x5f, 0x69, 0x1e, 0x15, 0x82,
    0xa7, 0xb8, 0x29, 0x6c, 0xff, 0x6b, 0xec, 0x23, 0xe3, 0x17, 0x32, 0x19, 0xc4, 0xe6, 0x25, 0x97,
    0x94, 0xe4, 0x05, 0xe9, 0xa8, 0xe2, 0x46, 0x7f, 0x9d, 0x9d, 0x99, 0x67, 0x64, 0x83, 0x77, 0x1c,
    0x09, 0xce, 0x9c, 0x6c, 0x2a, 0xcc, 0xde, 0xa0, 0x39, 0xa0, 0x61, 0x8f, 0xad, 0x05, 0xcf, 0x61,
    0x4d, 0x41, 0x65, 0x47, 0x3d, 0xad, 0x98, 0x9c, 0xab, 0x68, 0x5b, 0x5f, 0x8f, 0xbb, 0x49, 0x72,
    0xb5, 0x12, 0xd7, 0x21, 0x86, 0x56, 0x5e, 0xc7, 0xfd, 0xf9, 0x9e, 0xdf, 0x3e, 0x61, 0x3c, 0x55,
    0x7f, 0xc2, 0xd0, 0xe4, 0x52, 0xcb, 0x77, 0x28, 0x3d, 0xcf, 0xc5, 0x78, 0xde, 0x4a, 0x0d, 0x64,
    0x85, 0x00, 0xb8, 0xb6, 0xd2, 0x70, 0xf4, 0xf7, 0x54, 0xf1, 0x46, 0xac, 0xfa, 0xe4, 0x13, 0x7b,
    0xaf, 0xa6, 0xaa, 0xf3, 0xe0, 0x8b, 0x7e, 0xb6, 0x5c, 0xd7, 0x81, 0x8a, 0xc8, 0x26, 0x29, 0xc4,
    0x00, 0xe3, 0x65, 0x7e, 0x97, 0x4e, 0xd6, 0x1b, 0xa7, 0xa5, 0x58, 0x23, 0x2b, 0x35, 0xb6, 0x47,
    0x91, 0xe3, 0xb5, 0xc0, 0xbd, 0x52, 0xa2, 0x62, 0x1d, 0x66, 0xab, 0x4b, 0x56, 0xc1, 0xf7, 0x62,
    0xdd, 0x89, 0xdc, 0x31, 0xf6, 0x4c, 0x68, 0x73, 0x7a, 0xdb, 0xc5, 0x35, 0x68, 0x91, 0x4d, 0xb8,
    0xf1, 0xa5, 0x8b, 0x00, 0xaf, 0xfa, 0x6b, 0x95, 0xfc, 0xe3, 0xa4, 0x88, 0x49, 0xce, 0x57, 0x97,
    0x09, 0xe4, 0x02, 0x47, 0xb3, 0x44, 0xb9, 0x25, 0xf2, 0xc4, 0x38, 0xa8, 0x2f, 0xf0, 0x08, 0xd8,
    0x4b, 0x99, 0x82, 0xb5, 0x3d, 0x0a, 0xa8, 0x49, 0xbf, 0x36, 0x16, 0x00, 0x91, 0x81, 0x94, 0x68,
    0x50, 0x8f, 0x82, 0x5b, 0x10, 0xba, 0x37, 0x04, 0x63, 0x21, 0x6d, 0x2c, 0x34, 0x1b, 0x5c, 0xb1,
    0x34, 0x38, 0xc8, 0x0f, 0xd7, 0x4b, 0x42, 0x7c, 0xfc, 0x79, 0x26, 0xb1, 0xee, 0x02, 0xd7, 0x6d,
    0x86, 0x71, 0xc6, 0x0e, 0xe2, 0xc3, 0x03, 0x72, 0x8c, 0x89, 0x0d, 0xa3, 0x7f, 0x9c, 0xe2, 0x9f
    } };

    if( !fd_lthash_equal( &lthash_out, &expected_hash ) ) {
      FD_LOG_ERR(( "Test case 2 failed: hash mismatch" ));
    }
    FD_TEST( fd_lthash_equal( &lthash_out, &expected_hash ) );
  }

  /* Test case 3: Non-zero lamports with executable=1 */
  {
    fd_pubkey_t pubkey;
    memset( &pubkey, 0x44, sizeof(fd_pubkey_t) );

    fd_account_meta_t account;
    account.lamports = 2000UL;
    account.executable = 1;
    memset( account.owner, 0x55, FD_PUBKEY_FOOTPRINT );
    account.dlen = 75UL;

    uchar data[75];
    memset( data, 0x66, 75 );

    fd_lthash_value_t lthash_out;
    fd_hashes_account_lthash( &pubkey, &account, data, &lthash_out );

    /* Expected hash value for test case 3 */
    fd_lthash_value_t expected_hash = {
      .bytes = {
         0xa5, 0x7b, 0xc2, 0xf5, 0xe5, 0xae, 0xa5, 0x51, 0xa7, 0x1a, 0x02, 0xa0, 0xb2, 0x55, 0x63, 0x26,
    0x48, 0xb8, 0xd4, 0xa3, 0xab, 0x58, 0xed, 0x97, 0xd1, 0xff, 0x32, 0x07, 0x22, 0x0a, 0x85, 0x35,
    0xc7, 0x73, 0x07, 0x43, 0xa2, 0xf9, 0xb2, 0xe5, 0x87, 0x02, 0x19, 0x47, 0xe4, 0x37, 0x0b, 0x3d,
    0x06, 0x0e, 0x8f, 0x9a, 0xed, 0x71, 0x95, 0xf0, 0xd5, 0x50, 0xd7, 0x12, 0x14, 0xd6, 0x1e, 0x90,
    0x88, 0xf2, 0x0c, 0xaf, 0xb0, 0x4a, 0x17, 0x8a, 0xc6, 0x97, 0xc2, 0xb6, 0x7c, 0xb1, 0x1d, 0x28,
    0xe8, 0x28, 0xbf, 0x7c, 0xcd, 0x77, 0x41, 0x2e, 0x55, 0x55, 0x81, 0x2b, 0x7f, 0xd6, 0xa4, 0x22,
    0xf7, 0xe1, 0xb2, 0xf2, 0xb8, 0xe9, 0xeb, 0x0d, 0x1e, 0x94, 0x83, 0x10, 0x4a, 0xe4, 0x3a, 0xea,
    0xde, 0xc3, 0xf9, 0xb4, 0x25, 0x97, 0x83, 0x34, 0x8d, 0xae, 0x8b, 0x21, 0x5d, 0x2d, 0xb3, 0x61,
    0xd4, 0x99, 0x31, 0x85, 0x10, 0xac, 0x24, 0x34, 0x75, 0xae, 0xa6, 0x88, 0x07, 0x1a, 0xee, 0xbf,
    0xbd, 0xfc, 0x2b, 0x19, 0xb5, 0x5f, 0x07, 0x1b, 0x18, 0x9e, 0x1a, 0x7b, 0x6b, 0xf5, 0xcb, 0x67,
    0x07, 0xd0, 0xf6, 0xc0, 0x32, 0xff, 0x06, 0x5f, 0x36, 0xba, 0x93, 0x69, 0x59, 0x23, 0x37, 0x80,
    0x0a, 0x16, 0xf7, 0x1a, 0x8e, 0x1a, 0x6f, 0x19, 0xe8, 0x60, 0x82, 0x44, 0x45, 0x70, 0x33, 0xec,
    0x0a, 0x5d, 0x8c, 0xca, 0xc8, 0xc2, 0xf8, 0xdc, 0x0d, 0xd7, 0x9d, 0xd7, 0x9e, 0xca, 0xbc, 0x06,
    0x1e, 0xc3, 0x80, 0xcc, 0x0c, 0xa9, 0x1e, 0x6f, 0xe6, 0x5d, 0x4e, 0xda, 0xea, 0x3f, 0x2a, 0xa6,
    0x92, 0x36, 0x01, 0x2c, 0x43, 0xfa, 0xfa, 0x8d, 0x74, 0xd2, 0xa0, 0x86, 0xe9, 0xd1, 0xe9, 0xd4,
    0xcd, 0xbb, 0xe3, 0xf9, 0x58, 0xf6, 0xb9, 0x47, 0x94, 0x91, 0xb9, 0x66, 0xc3, 0x92, 0x49, 0xaf,
    0x7c, 0xf1, 0x75, 0x6e, 0x0e, 0x8b, 0xcc, 0x03, 0xc6, 0x5e, 0x7a, 0x18, 0xbe, 0xfe, 0xc9, 0x9e,
    0xfb, 0xb0, 0x13, 0x68, 0xbd, 0x47, 0x50, 0xef, 0x9e, 0x96, 0x39, 0x22, 0x42, 0x8a, 0xa4, 0x41,
    0x21, 0x16, 0x79, 0x9c, 0xa2, 0x64, 0x27, 0x8d, 0x92, 0x34, 0x39, 0xba, 0xf5, 0xbe, 0x8c, 0x7d,
    0x32, 0x94, 0xdd, 0x69, 0x5c, 0x05, 0xc2, 0xd2, 0x6d, 0xbc, 0xc2, 0x33, 0xe7, 0xdd, 0xc7, 0x8b,
    0xa6, 0x79, 0xf7, 0xbd, 0xae, 0x2f, 0x9f, 0xd6, 0xcc, 0x89, 0xd6, 0x85, 0xbd, 0xfe, 0xc5, 0xd9,
    0xc7, 0xf9, 0x67, 0x6f, 0x43, 0x9d, 0xce, 0x9f, 0x38, 0x1e, 0x1d, 0x6a, 0x6c, 0x7e, 0x2b, 0x2c,
    0x5a, 0x42, 0x8b, 0x79, 0xb0, 0xfc, 0xc8, 0x6f, 0x58, 0x39, 0x97, 0xca, 0x8b, 0x11, 0x94, 0x50,
    0xca, 0xe9, 0x39, 0x5d, 0x41, 0xd5, 0xee, 0xeb, 0x32, 0x6c, 0x0c, 0xaf, 0x25, 0x44, 0x56, 0x7e,
    0x92, 0xcb, 0x6b, 0x81, 0x4d, 0x56, 0xf0, 0xed, 0xb1, 0x08, 0x63, 0xd0, 0x59, 0x33, 0xab, 0xcb,
    0xea, 0x76, 0x42, 0x46, 0x66, 0xeb, 0x09, 0x06, 0x0e, 0x13, 0x95, 0xcb, 0x06, 0x9a, 0x93, 0xd1,
    0x72, 0x97, 0xa3, 0x4f, 0xe8, 0x51, 0x6e, 0x02, 0x77, 0x7d, 0x85, 0x7a, 0x7b, 0xb2, 0x32, 0xae,
    0x50, 0x25, 0x62, 0x9d, 0xa9, 0xea, 0xef, 0xd8, 0xa3, 0xe1, 0xd8, 0xd8, 0xb2, 0xa9, 0xe9, 0x8f,
    0x01, 0x2c, 0x5f, 0x0f, 0x63, 0x0b, 0x2a, 0x00, 0x2e, 0x27, 0x74, 0xeb, 0xdd, 0xf7, 0xeb, 0x7f,
    0x0b, 0x86, 0x55, 0x76, 0xd8, 0x1b, 0xf8, 0x69, 0xff, 0xd7, 0xb6, 0xb3, 0x75, 0x6d, 0xd9, 0x8b,
    0xde, 0xd7, 0xd7, 0x00, 0xff, 0xfa, 0x15, 0x18, 0xd9, 0x70, 0x56, 0x00, 0x53, 0x55, 0x69, 0xdc,
    0x7d, 0x49, 0x92, 0xd5, 0x12, 0x03, 0x61, 0xa3, 0x85, 0xf7, 0x4a, 0xee, 0x45, 0x8c, 0x79, 0x22,
    0xd4, 0x54, 0xea, 0xc0, 0x72, 0x02, 0x3b, 0x45, 0xd6, 0x55, 0xe5, 0xf1, 0xa4, 0x9e, 0xdb, 0xa3,
    0xa6, 0x0e, 0x61, 0xb6, 0x93, 0x62, 0x99, 0xbf, 0x75, 0x5f, 0xb9, 0x41, 0xe0, 0xda, 0x2a, 0xdf,
    0x3b, 0x41, 0x17, 0x21, 0xf9, 0x9f, 0x82, 0x6a, 0x99, 0x63, 0x5c, 0xb4, 0xa8, 0xc4, 0xb5, 0x85,
    0x2d, 0x62, 0xe0, 0x68, 0x4a, 0x04, 0x2e, 0x73, 0xb1, 0x05, 0xe8, 0x6b, 0x4b, 0xac, 0xb9, 0xeb,
    0x78, 0x71, 0x8c, 0x06, 0xf2, 0x6e, 0xa2, 0x05, 0xe7, 0xff, 0x3f, 0xca, 0x26, 0xdf, 0x4e, 0xc0,
    0x1d, 0xb6, 0x60, 0x5d, 0x4a, 0x1a, 0x77, 0xb9, 0xd1, 0x4b, 0xc1, 0x3c, 0xc0, 0x88, 0x97, 0xdb,
    0xd5, 0xce, 0x53, 0x8c, 0x06, 0xe8, 0xe8, 0x2d, 0x97, 0xb7, 0xcb, 0xd4, 0x51, 0x42, 0xd2, 0xf5,
    0x14, 0x43, 0x5f, 0x1f, 0xbc, 0xee, 0xae, 0xe5, 0xa3, 0xf0, 0x91, 0xb2, 0x4c, 0xc8, 0x1a, 0xd3,
    0x2f, 0xb9, 0x65, 0xcc, 0xdd, 0x34, 0x88, 0x0a, 0x94, 0x57, 0xd6, 0x41, 0x70, 0xec, 0xc2, 0x2f,
    0xe2, 0xed, 0xd4, 0x9f, 0x03, 0x93, 0x45, 0x86, 0x6e, 0xfc, 0xf5, 0x11, 0x87, 0xa3, 0x9d, 0xf6,
    0xa2, 0x46, 0x0a, 0x02, 0x43, 0xd5, 0x08, 0x4f, 0x58, 0xb7, 0xd0, 0x88, 0xbc, 0x9f, 0x85, 0x1a,
    0xde, 0xad, 0xf9, 0xe6, 0x2f, 0x9c, 0xed, 0x0d, 0x85, 0x41, 0xb0, 0xb4, 0x67, 0x9c, 0x9b, 0xe4,
    0x6e, 0xa7, 0x70, 0xce, 0x9b, 0xa7, 0xef, 0x02, 0x17, 0xab, 0x1f, 0x38, 0x95, 0xf3, 0x24, 0x12,
    0x2d, 0xa1, 0x59, 0x41, 0xc4, 0x22, 0xd5, 0x97, 0x6e, 0x3c, 0x88, 0x81, 0xc5, 0xc5, 0xde, 0xde,
    0xf6, 0x6f, 0xb3, 0xfd, 0xaa, 0xae, 0x60, 0x4d, 0x94, 0x2b, 0x0a, 0xde, 0x94, 0xa3, 0xb0, 0x6a,
    0x02, 0x31, 0x50, 0x02, 0xe6, 0xd8, 0x71, 0x15, 0xec, 0x38, 0x1c, 0xef, 0x11, 0x44, 0x79, 0x9d,
    0x14, 0xb9, 0x32, 0xe3, 0xef, 0xc3, 0xf6, 0xf0, 0x4e, 0xfa, 0x7a, 0xd2, 0xd5, 0x03, 0xe5, 0xfb,
    0x2e, 0xec, 0x3c, 0xbf, 0xf7, 0xf2, 0x05, 0xf2, 0xa7, 0x6b, 0x83, 0x05, 0xc4, 0x1f, 0x63, 0x5a,
    0xf8, 0x99, 0xbd, 0x3f, 0x38, 0xcd, 0x82, 0x7d, 0x53, 0x2b, 0x16, 0xa7, 0xde, 0x61, 0x04, 0x7e,
    0xbf, 0xc5, 0x9b, 0xb6, 0xc1, 0xc5, 0x1c, 0xa4, 0x25, 0x91, 0xb6, 0xeb, 0x47, 0xeb, 0xa1, 0x5a,
    0xad, 0xf4, 0x4d, 0xd5, 0x6a, 0x4f, 0xc4, 0xfa, 0x50, 0xbc, 0x16, 0x59, 0x2d, 0x9e, 0x1a, 0x68,
    0x9f, 0xfe, 0xdd, 0x5b, 0xb8, 0xf1, 0x52, 0xa8, 0x2b, 0x76, 0x84, 0x3a, 0xf9, 0x11, 0x25, 0x7d,
    0x91, 0x8e, 0x4e, 0x49, 0x00, 0x58, 0x79, 0x8a, 0x11, 0x4e, 0x86, 0xf8, 0x8e, 0xda, 0x93, 0x31,
    0x61, 0x34, 0xc7, 0x40, 0xc9, 0xe7, 0xdb, 0x87, 0x8b, 0x91, 0x50, 0xac, 0x57, 0xc2, 0x87, 0x0a,
    0xe3, 0x47, 0x41, 0x7f, 0x28, 0x31, 0x27, 0x22, 0xa9, 0xba, 0x8c, 0xed, 0xb9, 0xbc, 0x7a, 0x67,
    0xfb, 0xcd, 0xa4, 0x72, 0x27, 0x9d, 0x42, 0x6a, 0xf1, 0x52, 0x52, 0xfd, 0x81, 0xf1, 0xf9, 0xd4,
    0x43, 0xba, 0xeb, 0xf7, 0xaa, 0x34, 0x98, 0x14, 0x58, 0x6f, 0x4d, 0x5d, 0x00, 0x54, 0xf1, 0xf3,
    0xa9, 0xc3, 0x08, 0xe7, 0xa0, 0xbd, 0x04, 0x1d, 0x4a, 0xcb, 0xbb, 0x18, 0xcd, 0x0c, 0x33, 0xde,
    0x36, 0xe6, 0xde, 0xec, 0xe4, 0x58, 0x76, 0x4d, 0x98, 0x03, 0xd6, 0xa5, 0xd4, 0xad, 0x2b, 0xef,
    0xd9, 0x05, 0x57, 0xdb, 0x2e, 0xab, 0x9a, 0x83, 0x1e, 0xda, 0x52, 0x9e, 0x60, 0xe6, 0xd1, 0x93,
    0xa1, 0xa0, 0x47, 0x05, 0xfc, 0xf7, 0x3e, 0xa7, 0x3b, 0xb5, 0x3a, 0x68, 0xcc, 0x43, 0xb9, 0xf2,
    0x64, 0x81, 0x26, 0x66, 0x36, 0xaa, 0xc6, 0xcd, 0xbe, 0xcd, 0x36, 0xc0, 0xab, 0xe2, 0x5e, 0x3d,
    0x0c, 0xfa, 0x61, 0x2e, 0x45, 0xf6, 0xc9, 0x60, 0xf9, 0x22, 0xb3, 0x44, 0x67, 0xa1, 0x9f, 0x70,
    0x9a, 0x0d, 0x5b, 0x47, 0xfd, 0xb8, 0xee, 0x9f, 0x58, 0x69, 0x13, 0x58, 0x41, 0xbd, 0xe9, 0x41,
    0xec, 0x5b, 0xdd, 0xd0, 0x6e, 0x05, 0xe1, 0x8f, 0xde, 0x2c, 0xaf, 0xdf, 0xd2, 0xff, 0x22, 0xd9,
    0x0a, 0x70, 0xb2, 0x73, 0xed, 0x8f, 0x9d, 0xc1, 0x90, 0x17, 0xf8, 0xfe, 0xa9, 0x6e, 0x81, 0x82,
    0x28, 0xf6, 0xd0, 0xea, 0x2b, 0xa2, 0xc7, 0x69, 0x53, 0x07, 0xf5, 0x52, 0x33, 0xc5, 0x04, 0xcf,
    0x5d, 0x46, 0x0c, 0xc2, 0x68, 0x6c, 0x00, 0xd8, 0xce, 0x61, 0x71, 0x37, 0x78, 0x49, 0x06, 0x8f,
    0xdf, 0x34, 0xa6, 0xab, 0x32, 0x23, 0x7a, 0x59, 0xc9, 0xaf, 0x9b, 0x87, 0x96, 0x8b, 0x6e, 0x51,
    0x2f, 0x41, 0x9f, 0xad, 0x65, 0x12, 0xa2, 0x72, 0x3e, 0x35, 0xd1, 0xe8, 0x5f, 0xa6, 0xf9, 0x6a,
    0xcf, 0x1c, 0x0e, 0x79, 0xc4, 0x7c, 0x32, 0xa2, 0x59, 0x66, 0x10, 0x46, 0x85, 0x11, 0xfc, 0x4e,
    0x63, 0xb4, 0x0f, 0x16, 0xb7, 0x5c, 0x1a, 0x49, 0xf7, 0x6d, 0xc9, 0x37, 0xc6, 0x9f, 0x87, 0x5c,
    0x6f, 0x6e, 0x0d, 0x14, 0x0f, 0xe5, 0x36, 0x8b, 0x35, 0xf4, 0x7a, 0x6a, 0x71, 0x13, 0xec, 0xd8,
    0x4d, 0xbc, 0x99, 0x06, 0x66, 0x06, 0x54, 0x79, 0x2e, 0xaf, 0xc3, 0x90, 0xfc, 0x92, 0x85, 0xea,
    0xf3, 0x6c, 0x9a, 0x65, 0x02, 0x8d, 0x76, 0x35, 0x2a, 0xa1, 0xe5, 0xa2, 0xcc, 0x59, 0x52, 0xdd,
    0x60, 0xcc, 0x29, 0xcd, 0xc6, 0x4c, 0x17, 0x56, 0x5c, 0xbd, 0x82, 0x23, 0x55, 0xe2, 0x42, 0x32,
    0x84, 0x67, 0x07, 0x80, 0xf8, 0xd7, 0x3f, 0x14, 0xbc, 0x7b, 0x1c, 0x9f, 0x19, 0xcb, 0x5d, 0x84,
    0xff, 0x18, 0x84, 0x1f, 0x76, 0x96, 0xbf, 0xa7, 0xce, 0x96, 0x86, 0x1a, 0x87, 0xae, 0x04, 0xf0,
    0x76, 0x27, 0xea, 0x11, 0x63, 0x05, 0x99, 0x81, 0x2b, 0xda, 0xed, 0x2e, 0x1f, 0x06, 0x7b, 0x19,
    0x1a, 0x21, 0x86, 0x11, 0xf4, 0x0a, 0x3c, 0x27, 0xa4, 0x4c, 0x94, 0x39, 0xc9, 0x40, 0x3f, 0xab,
    0xb9, 0xa7, 0x6f, 0x20, 0xc1, 0x42, 0xce, 0x97, 0x31, 0x41, 0xa1, 0xb6, 0x9d, 0xca, 0x12, 0xc9,
    0x1a, 0x93, 0x16, 0x25, 0x7e, 0x37, 0xdb, 0x75, 0x4c, 0x99, 0x13, 0x21, 0x7e, 0x28, 0x87, 0xb8,
    0xde, 0xf7, 0x4e, 0x90, 0x49, 0x6d, 0x66, 0x64, 0x2e, 0xfe, 0xa8, 0xd1, 0x28, 0x52, 0xe3, 0x3b,
    0x7f, 0xba, 0x56, 0x74, 0xb8, 0xe3, 0xba, 0x3c, 0x90, 0xe2, 0x62, 0xb8, 0x36, 0x0b, 0x2a, 0x43,
    0x82, 0x2b, 0x19, 0xc0, 0x62, 0x20, 0x83, 0x60, 0x39, 0xc3, 0x12, 0x40, 0x6a, 0xde, 0xae, 0xc2,
    0x04, 0xb9, 0x87, 0xc1, 0x44, 0xe5, 0x02, 0x32, 0xfa, 0x07, 0x82, 0xa8, 0xa6, 0x20, 0xe6, 0x8b,
    0x5e, 0x9d, 0x52, 0xb3, 0x81, 0xe9, 0xcf, 0xa5, 0xf9, 0x85, 0x6f, 0xb7, 0xe6, 0xfb, 0x21, 0xb8,
    0x6a, 0xe8, 0x7b, 0x64, 0xa9, 0x91, 0x02, 0x39, 0x93, 0xfd, 0xfd, 0xf0, 0x56, 0x72, 0xf5, 0xc2,
    0x94, 0xf3, 0x99, 0xce, 0xc3, 0x8c, 0x5e, 0x2b, 0x4e, 0x96, 0x59, 0xc4, 0xed, 0x6b, 0x8c, 0x70,
    0xea, 0x5e, 0xad, 0x72, 0xb5, 0x2b, 0xb5, 0x05, 0x75, 0xb9, 0x33, 0x6c, 0x32, 0xf2, 0x5b, 0xfe,
    0x76, 0x86, 0x69, 0xfe, 0x4f, 0x19, 0xd1, 0xc6, 0x3f, 0xa8, 0x06, 0xd0, 0x3e, 0x09, 0x81, 0x7a,
    0xa4, 0xb9, 0x43, 0xc6, 0x07, 0x5e, 0xb9, 0xbd, 0xb8, 0x7a, 0x1f, 0x43, 0xa7, 0x1e, 0x57, 0x59,
    0x5b, 0xda, 0x5f, 0x1b, 0x3f, 0xf3, 0x54, 0x6a, 0xe8, 0xad, 0x59, 0x80, 0x7c, 0x47, 0x65, 0xc8,
    0xf6, 0xb1, 0x7e, 0x75, 0xae, 0x8f, 0xea, 0x74, 0x08, 0x2f, 0x00, 0xe9, 0x5c, 0x87, 0x9e, 0x73,
    0x4d, 0x69, 0x97, 0xe4, 0x33, 0x27, 0x1e, 0xca, 0xc3, 0xa4, 0x20, 0x6d, 0xb0, 0xad, 0x5f, 0x39,
    0x34, 0x3b, 0x2e, 0x13, 0x5c, 0x9f, 0x42, 0xde, 0xe5, 0x94, 0xa7, 0x08, 0xc1, 0x43, 0x69, 0xaf,
    0xe4, 0x64, 0x7a, 0x59, 0xe8, 0x1d, 0xa7, 0x55, 0xbe, 0x49, 0xf0, 0xd5, 0x58, 0x2a, 0x3b, 0xd0,
    0x46, 0x96, 0x5e, 0xc1, 0xef, 0x16, 0xcb, 0x4a, 0xae, 0xaf, 0xdd, 0x96, 0x5c, 0x10, 0xbc, 0xd4,
    0xdf, 0x83, 0x13, 0xa3, 0xce, 0xd5, 0x11, 0x0b, 0x12, 0xd4, 0xb8, 0x82, 0xb8, 0x76, 0x54, 0x7c,
    0xca, 0xce, 0xb6, 0xa6, 0xec, 0xbf, 0xcd, 0xaa, 0x1e, 0x6f, 0x84, 0x9a, 0x3b, 0x33, 0xf4, 0xdc,
    0x40, 0x2e, 0xa4, 0x65, 0xc6, 0x09, 0x89, 0x38, 0xd8, 0x5b, 0x57, 0x9d, 0x35, 0x31, 0x47, 0x22,
    0x0b, 0x1e, 0x02, 0xe3, 0xb5, 0xba, 0x3c, 0x88, 0x02, 0x03, 0x35, 0x55, 0x05, 0xa9, 0x78, 0xa0,
    0x85, 0x93, 0x36, 0x2d, 0xfb, 0x22, 0x82, 0xaf, 0xa6, 0x8c, 0xd2, 0xbd, 0x58, 0x91, 0xfd, 0x00,
    0x97, 0xa6, 0xd7, 0xf7, 0x4b, 0xb4, 0x53, 0xb4, 0xa3, 0xa6, 0x3f, 0xfa, 0x1b, 0x88, 0x39, 0xb2,
    0x4b, 0xce, 0x8c, 0xd7, 0xdb, 0x5d, 0xc0, 0xe5, 0x52, 0x48, 0xa3, 0x9a, 0x51, 0x3b, 0x12, 0xd0,
    0xaf, 0x93, 0x6f, 0x98, 0x3d, 0x39, 0x5e, 0xd0, 0x13, 0x88, 0xc5, 0x51, 0x62, 0x9e, 0x64, 0xa2,
    0x0a, 0xa7, 0x87, 0xa9, 0x11, 0x48, 0x0b, 0x1e, 0x0a, 0x82, 0xeb, 0x39, 0x56, 0xc5, 0xe0, 0xcb,
    0x86, 0xd3, 0xef, 0x70, 0xe7, 0xcc, 0xd0, 0x83, 0x9d, 0xe6, 0x87, 0xd3, 0x28, 0x6d, 0xaa, 0x56,
    0xda, 0x73, 0xd2, 0x7a, 0xba, 0xd0, 0xf4, 0x67, 0x78, 0x92, 0xba, 0x4c, 0xbb, 0x59, 0x85, 0xf3,
    0xd3, 0x10, 0x9e, 0x6f, 0x62, 0xa1, 0x68, 0x94, 0x34, 0x13, 0x59, 0x93, 0xc6, 0x16, 0xf7, 0x42,
    0x9a, 0x1c, 0xbf, 0x4c, 0xab, 0xa3, 0x0d, 0x63, 0xc1, 0x5d, 0xec, 0x76, 0xf5, 0xfa, 0xae, 0x8e,
    0x21, 0xab, 0xfb, 0x25, 0x59, 0x7e, 0x59, 0x1c, 0x59, 0x10, 0xb9, 0xe2, 0x9d, 0x03, 0x1d, 0x2b,
    0xa5, 0x1d, 0xed, 0xfc, 0x2b, 0x10, 0xba, 0x6e, 0xbc, 0x6a, 0x30, 0x55, 0x70, 0x8f, 0xc3, 0xe5,
    0xbf, 0x43, 0x8a, 0xcf, 0x68, 0x86, 0xde, 0xdb, 0x34, 0x7a, 0x0a, 0x22, 0x2c, 0xf1, 0xe5, 0xe4,
    0xa0, 0x1a, 0x01, 0xce, 0xca, 0xcd, 0xcf, 0x0a, 0x3a, 0x6a, 0xe7, 0xdc, 0x54, 0xe1, 0x89, 0xe7,
    0x15, 0x47, 0x23, 0x0a, 0xb7, 0xdb, 0x29, 0xc5, 0x0d, 0x4d, 0x47, 0x61, 0x20, 0xcd, 0xe0, 0xdf,
    0xd7, 0x4a, 0xb8, 0x66, 0xaa, 0x16, 0x44, 0xa3, 0x42, 0xc6, 0x43, 0x80, 0x6e, 0x06, 0x1a, 0x66,
    0x45, 0xd4, 0xc8, 0x58, 0x18, 0x19, 0x62, 0x51, 0x38, 0x4f, 0xbb, 0x0a, 0xfb, 0x5a, 0xa1, 0xb2,
    0x48, 0x8d, 0x1b, 0x41, 0xd6, 0x57, 0x43, 0xcc, 0x4c, 0x4d, 0xe7, 0xf1, 0x35, 0xda, 0x8f, 0xa9,
    0x79, 0xd3, 0xfb, 0x8d, 0xa1, 0x57, 0x66, 0xd8, 0x5f, 0x90, 0x82, 0x44, 0x05, 0xa7, 0x41, 0xee,
    0x88, 0x26, 0x8d, 0xd4, 0xf8, 0x38, 0xb7, 0x42, 0x21, 0x1a, 0xec, 0x5c, 0x1d, 0x28, 0x5d, 0xf1,
    0xf8, 0xa6, 0xb8, 0x70, 0xcb, 0x54, 0xa5, 0x15, 0x6a, 0x8e, 0xbe, 0xb7, 0xfd, 0x9e, 0xd6, 0x14,
    0x8f, 0x2d, 0xc1, 0x24, 0xd9, 0xeb, 0xcd, 0xd5, 0x4f, 0xa2, 0x4d, 0x90, 0x6e, 0xdc, 0x83, 0xbf,
    0x6c, 0xe6, 0xd1, 0x03, 0x3a, 0xc9, 0xd1, 0xa4, 0x6b, 0xda, 0xfa, 0x27, 0x05, 0xdc, 0x13, 0x2d,
    0xdf, 0xed, 0x97, 0x0f, 0x58, 0x86, 0x4c, 0x93, 0x0e, 0x98, 0x91, 0x41, 0x2b, 0x97, 0x17, 0x15,
    0xd6, 0x74, 0x61, 0x58, 0x73, 0xd2, 0x4a, 0x48, 0x9a, 0x19, 0x49, 0x81, 0x89, 0xd1, 0x72, 0xa0
      }
    };

    if( !fd_lthash_equal( &lthash_out, &expected_hash ) ) {
      FD_LOG_ERR(( "Test case 3 failed: hash mismatch" ));
    }
    FD_TEST( fd_lthash_equal( &lthash_out, &expected_hash ) );
  }

  /* Test case 4: Non-zero lamports with executable=255 (should be treated as 1) */
  {
    fd_pubkey_t pubkey;
    memset( &pubkey, 0x77, sizeof(fd_pubkey_t) );

    fd_account_meta_t account;
    account.lamports = 3000UL;
    account.executable = 255;  /* Should be masked to 1 */
    memset( account.owner, 0x88, FD_PUBKEY_FOOTPRINT );
    account.dlen = 25UL;

    uchar data[25];
    memset( data, 0x99, 25 );

    fd_lthash_value_t lthash_out;
    fd_hashes_account_lthash( &pubkey, &account, data, &lthash_out );

    /* Expected hash value for test case 4 - same as executable=1 */
    fd_lthash_value_t expected_hash = {
      .bytes = {
        0xbf, 0x86, 0x97, 0x61, 0xec, 0x8d, 0xc4, 0x0b, 0x25, 0x11, 0x79, 0xa7, 0xfe, 0xe7, 0xb6, 0x66,
    0x9a, 0xdb, 0xa9, 0xcd, 0x50, 0x35, 0x1c, 0x7f, 0x79, 0x9f, 0xce, 0xb1, 0xef, 0xf2, 0x43, 0x39,
    0xfc, 0x5c, 0x72, 0x40, 0xfd, 0x66, 0xa0, 0x4b, 0xa0, 0xcb, 0x48, 0x16, 0xd0, 0x3a, 0x0a, 0xda,
    0x6e, 0xfb, 0x93, 0xbf, 0xd6, 0xbe, 0x66, 0x12, 0x37, 0xf6, 0x95, 0x78, 0xa9, 0x82, 0xa7, 0x33,
    0x33, 0xb2, 0x8b, 0x48, 0x06, 0xc1, 0x61, 0xb6, 0x6c, 0x8a, 0x7c, 0xed, 0xa9, 0x4f, 0x56, 0xcb,
    0x26, 0x9f, 0xcf, 0xbd, 0xd7, 0xd6, 0x6b, 0xd0, 0x5d, 0x87, 0x82, 0xe3, 0xaa, 0xdf, 0xf5, 0x1c,
    0x30, 0x75, 0xbe, 0x10, 0x6f, 0x2f, 0xd9, 0x68, 0x9f, 0xf9, 0xd2, 0x65, 0xa7, 0x0d, 0xd7, 0x5b,
    0x18, 0x0c, 0x0e, 0xdc, 0x95, 0x9d, 0xcd, 0x66, 0x44, 0x51, 0x3b, 0x2c, 0x30, 0x73, 0x56, 0x9b,
    0xc9, 0xf3, 0xdd, 0x1b, 0x44, 0xed, 0xc1, 0x0c, 0x55, 0x81, 0xb0, 0xe4, 0xea, 0x46, 0xe1, 0x3f,
    0x17, 0x8b, 0x53, 0x92, 0x5e, 0xe7, 0x62, 0x6b, 0x54, 0x35, 0x5a, 0xd7, 0xde, 0xeb, 0x85, 0x6a,
    0xe5, 0x99, 0xa8, 0xf8, 0x01, 0xdd, 0xb7, 0x0c, 0x84, 0x91, 0xf4, 0x8c, 0x7d, 0x6b, 0x8f, 0x9a,
    0xad, 0x5e, 0x6e, 0x26, 0x48, 0x55, 0xe8, 0x89, 0xa3, 0xe5, 0x46, 0x92, 0xa1, 0x05, 0xb3, 0x8a,
    0x21, 0x8a, 0xf9, 0x45, 0x42, 0xd0, 0x77, 0x47, 0x93, 0x8a, 0xf3, 0xba, 0xcc, 0x30, 0x2d, 0x75,
    0xa2, 0x87, 0x19, 0x7c, 0xa8, 0xaf, 0x0b, 0x1f, 0x63, 0x91, 0x71, 0x13, 0xdd, 0xa1, 0xd5, 0x05,
    0x13, 0x08, 0xe0, 0xaa, 0xeb, 0x43, 0x71, 0x57, 0x52, 0xf5, 0xf9, 0x68, 0xf5, 0x84, 0x3b, 0x88,
    0x99, 0x2e, 0x32, 0xee, 0xb2, 0x66, 0x34, 0xf6, 0x82, 0x91, 0xee, 0x58, 0x84, 0x17, 0x10, 0x2c,
    0x14, 0x46, 0xeb, 0x9e, 0x9d, 0x15, 0x70, 0xcf, 0xf5, 0xd1, 0x6b, 0x55, 0x20, 0xb0, 0x2d, 0x15,
    0xab, 0x95, 0x79, 0x40, 0xec, 0x4a, 0xd8, 0x74, 0xa0, 0x99, 0x99, 0x7c, 0x8f, 0xba, 0x1e, 0x4e,
    0xe9, 0x95, 0xa6, 0x87, 0x05, 0xdf, 0x15, 0xb1, 0xb0, 0x49, 0xd3, 0xc7, 0x44, 0x98, 0xd9, 0x77,
    0x1a, 0x5b, 0xcf, 0xa0, 0xa2, 0x10, 0x97, 0x10, 0x1a, 0xd9, 0x3f, 0xbb, 0x83, 0xd1, 0x92, 0x20,
    0xd5, 0x0a, 0xf3, 0xa9, 0x67, 0x10, 0xad, 0xf8, 0x7e, 0x64, 0x15, 0x40, 0xbf, 0x01, 0x66, 0xff,
    0x52, 0x6e, 0x9b, 0x10, 0x44, 0xcd, 0x3f, 0x73, 0x6f, 0x5d, 0xa5, 0xae, 0xcd, 0xe7, 0x2a, 0x5e,
    0x6f, 0x09, 0xe5, 0x9e, 0x58, 0xd5, 0xde, 0x88, 0xc7, 0xf9, 0xc8, 0x0e, 0xee, 0xb9, 0x49, 0xed,
    0x04, 0x82, 0x6d, 0x76, 0x7d, 0x80, 0xaf, 0xad, 0xc5, 0xd7, 0xd2, 0x51, 0x68, 0x46, 0xad, 0xd9,
    0x8c, 0x17, 0x66, 0x45, 0xeb, 0x6f, 0x94, 0xf4, 0xd9, 0xb0, 0x74, 0x50, 0x45, 0x9e, 0x35, 0x76,
    0x78, 0x31, 0x7e, 0xbb, 0x60, 0x00, 0x78, 0x42, 0xbc, 0x8c, 0xcf, 0xb0, 0xad, 0x35, 0x55, 0xde,
    0x27, 0x59, 0xbc, 0xd5, 0xf1, 0x74, 0x8a, 0x70, 0xa4, 0x16, 0x3a, 0x0f, 0x95, 0xaf, 0x17, 0xb0,
    0x67, 0xea, 0xb5, 0x66, 0x5f, 0xe5, 0xdf, 0xaa, 0xe5, 0x51, 0xd9, 0x8d, 0xf2, 0x9d, 0x68, 0x95,
    0x00, 0xb1, 0x4f, 0x1f, 0xf8, 0xea, 0x8d, 0xcf, 0x73, 0x72, 0x2e, 0xaf, 0x66, 0x36, 0x87, 0xb2,
    0xd8, 0x36, 0x2a, 0x8a, 0x77, 0x9e, 0xeb, 0x4c, 0xea, 0x6c, 0x69, 0x65, 0x64, 0xbf, 0xd1, 0xe6,
    0x8b, 0x34, 0x28, 0x38, 0xab, 0xeb, 0x9e, 0x96, 0x8a, 0x66, 0x18, 0x8b, 0x41, 0x24, 0x48, 0xa5,
    0x04, 0xb7, 0xa0, 0x47, 0x63, 0xfd, 0x07, 0x24, 0x26, 0xc4, 0x84, 0xad, 0x15, 0x07, 0xe4, 0xab,
    0xb5, 0x0c, 0xba, 0xe1, 0xb8, 0xb3, 0x83, 0x27, 0x0e, 0x31, 0x9b, 0x64, 0x39, 0xbd, 0x89, 0xa4,
    0x14, 0x6b, 0x8e, 0xef, 0x59, 0x41, 0x7f, 0xb1, 0xe5, 0x63, 0xfa, 0xce, 0x70, 0xde, 0xfd, 0x06,
    0xb0, 0xa8, 0xa4, 0xd2, 0xc9, 0x5a, 0x9e, 0x23, 0xab, 0xad, 0x2c, 0xaf, 0x74, 0x99, 0xf2, 0xc3,
    0x1b, 0xa1, 0xcc, 0xb2, 0xd9, 0x5b, 0xf4, 0x19, 0xe8, 0xf3, 0x2d, 0x96, 0xc3, 0x09, 0x18, 0xc7,
    0xd3, 0x31, 0x79, 0xfc, 0xb7, 0x81, 0x30, 0xd1, 0x76, 0xa3, 0xf4, 0xee, 0x0b, 0xd5, 0x34, 0xe3,
    0xef, 0x1a, 0x25, 0x54, 0xc5, 0xfd, 0x23, 0xcc, 0x6b, 0xdf, 0x2e, 0xa3, 0xd7, 0x11, 0x04, 0x8d,
    0x52, 0xe8, 0xe4, 0xcd, 0x98, 0x1b, 0xd3, 0x44, 0xce, 0x5f, 0x70, 0xc2, 0x81, 0x91, 0x05, 0x2e,
    0x02, 0x1b, 0x7c, 0x5b, 0x9d, 0xfb, 0x12, 0x0a, 0x05, 0x3f, 0x39, 0x2e, 0xb2, 0xc4, 0xb3, 0x66,
    0x3c, 0xc5, 0x4c, 0x37, 0x39, 0xee, 0x06, 0xfc, 0x20, 0x76, 0xc2, 0x89, 0x09, 0xba, 0x75, 0x22,
    0x2e, 0x69, 0x59, 0x73, 0xa1, 0x7f, 0xb6, 0xcf, 0xec, 0xb3, 0x32, 0x10, 0xb0, 0xff, 0xbf, 0x1b,
    0x15, 0x15, 0x26, 0xc1, 0x45, 0x76, 0x82, 0xdb, 0x99, 0xd8, 0x48, 0xd1, 0x1d, 0x00, 0x00, 0x1d,
    0xdf, 0xc8, 0xac, 0x7c, 0x3f, 0xc9, 0xf2, 0xd3, 0xed, 0x8e, 0x04, 0x27, 0x50, 0xd7, 0x02, 0x56,
    0x59, 0x28, 0x92, 0x11, 0xe6, 0xea, 0x5a, 0xf0, 0x41, 0xe7, 0x28, 0x3d, 0xad, 0x60, 0xcf, 0xc6,
    0xfd, 0x10, 0x1f, 0xd9, 0x1d, 0x99, 0x1a, 0xc8, 0xda, 0xe0, 0x77, 0x65, 0x6f, 0xf5, 0x4f, 0xac,
    0x58, 0x1b, 0xa8, 0x0a, 0x71, 0xfc, 0x17, 0xdf, 0x88, 0x24, 0xec, 0x43, 0x36, 0xd4, 0x44, 0xf2,
    0x3b, 0x9d, 0xb6, 0x7f, 0x18, 0x5c, 0x3d, 0x44, 0x85, 0x6b, 0x39, 0xc8, 0x8d, 0xbd, 0x46, 0xfc,
    0xbc, 0x6a, 0x0c, 0x99, 0xf2, 0xcc, 0x43, 0x02, 0x28, 0xac, 0x44, 0x7e, 0x70, 0x2d, 0x9c, 0x7f,
    0x44, 0x89, 0x6c, 0x47, 0xa5, 0x0e, 0x7a, 0x7e, 0x8e, 0x0b, 0x62, 0x54, 0xb0, 0x95, 0x34, 0xda,
    0x5d, 0xd1, 0xee, 0xaa, 0x4c, 0xce, 0xf9, 0x64, 0xf7, 0xab, 0xfd, 0x46, 0x82, 0x0f, 0x7c, 0x32,
    0x01, 0x8e, 0x17, 0x56, 0xcb, 0x17, 0x52, 0x2f, 0x77, 0xea, 0x9e, 0xf4, 0x8e, 0xd9, 0x61, 0xcb,
    0x4e, 0x11, 0xe8, 0x7c, 0xa7, 0xd0, 0x97, 0x5c, 0xf4, 0xa0, 0xe9, 0x7e, 0x3c, 0x5c, 0x1c, 0xda,
    0xe8, 0x58, 0x75, 0x81, 0x6b, 0xab, 0x96, 0x55, 0xc1, 0x2c, 0x9c, 0x4c, 0x89, 0x0a, 0xd5, 0x67,
    0xd6, 0xd3, 0xc5, 0xd1, 0x96, 0x54, 0x2a, 0xcf, 0xd3, 0xd0, 0x9b, 0xf4, 0x61, 0xc3, 0xa5, 0x06,
    0x8a, 0x71, 0x6d, 0x2a, 0x28, 0xaf, 0x48, 0x2e, 0xac, 0x3f, 0x65, 0x65, 0x9e, 0xef, 0xa1, 0x51,
    0x3f, 0x64, 0x7d, 0x8c, 0x15, 0x1c, 0x8e, 0x44, 0xae, 0xbb, 0xcd, 0x53, 0xd4, 0xd5, 0x64, 0xba,
    0xb6, 0x6f, 0xb6, 0xdf, 0x49, 0x4d, 0x10, 0xb7, 0xc7, 0xb2, 0x00, 0x22, 0xce, 0xef, 0x47, 0xbb,
    0xfe, 0xdd, 0x2e, 0x1f, 0x3b, 0xa1, 0x0b, 0x7f, 0x53, 0x1d, 0x29, 0xe5, 0x10, 0xaf, 0x0c, 0xd4,
    0x51, 0x7e, 0xfe, 0x4f, 0x89, 0xf8, 0x85, 0x84, 0x75, 0xe7, 0x0d, 0x2f, 0x49, 0x3c, 0x0c, 0x60,
    0xa3, 0x6d, 0x64, 0x19, 0x76, 0x1c, 0x37, 0x4e, 0xfa, 0xa9, 0x78, 0xb7, 0xc5, 0x85, 0x8d, 0xf6,
    0x10, 0xe9, 0x1c, 0x2b, 0x6c, 0x8b, 0x9e, 0x13, 0x62, 0xcf, 0x86, 0xed, 0x90, 0x8f, 0xc5, 0xe0,
    0xc8, 0x40, 0xa7, 0xab, 0x09, 0x41, 0xb0, 0x4c, 0x1f, 0xba, 0x16, 0x40, 0xb0, 0x19, 0x9b, 0x9a,
    0x4e, 0x40, 0xf3, 0x70, 0x9b, 0x26, 0x94, 0xff, 0x7d, 0x74, 0xec, 0xbe, 0x79, 0xe7, 0x14, 0x90,
    0x7f, 0xe6, 0x18, 0xbc, 0x75, 0xf6, 0xc6, 0xca, 0xf3, 0x6e, 0x5e, 0x72, 0x82, 0xca, 0xd5, 0x82,
    0x43, 0x16, 0x64, 0x85, 0xbc, 0x2d, 0xe2, 0xbd, 0x10, 0xdc, 0xde, 0x48, 0x9e, 0x25, 0xc3, 0x03,
    0x87, 0xbe, 0x18, 0x6b, 0x80, 0x56, 0x37, 0x9e, 0x91, 0x70, 0x6a, 0x77, 0x8d, 0x7b, 0x88, 0xa1,
    0x92, 0xe8, 0x8f, 0xad, 0x57, 0x3a, 0x2a, 0x4c, 0xd8, 0x7c, 0x3b, 0x64, 0x6a, 0x57, 0xdf, 0xa1,
    0x65, 0x4d, 0x65, 0x62, 0xfd, 0x89, 0x28, 0x06, 0x73, 0xe7, 0x3f, 0xe9, 0xf5, 0xd7, 0x50, 0xa1,
    0x70, 0xe3, 0xa7, 0xcf, 0x4c, 0xb5, 0x30, 0x09, 0x09, 0xcb, 0x75, 0x41, 0xd7, 0xb1, 0x6a, 0x21,
    0x41, 0x54, 0xd2, 0xac, 0xc5, 0xe6, 0x13, 0x49, 0xbf, 0x0d, 0xb5, 0x6e, 0x4c, 0x86, 0x37, 0xb7,
    0x52, 0x0b, 0xe4, 0x01, 0x31, 0x1c, 0xb2, 0x4c, 0xf6, 0xa2, 0xe8, 0xe4, 0x24, 0xe3, 0xa7, 0xd4,
    0xc3, 0x06, 0xbc, 0x42, 0x4c, 0xe1, 0x6b, 0x6a, 0xfd, 0xc7, 0xf7, 0xe1, 0xd9, 0x6c, 0x89, 0x81,
    0x40, 0x0e, 0x15, 0x8a, 0xc1, 0xba, 0xd6, 0x65, 0xfd, 0xa7, 0xa3, 0xc7, 0x4d, 0xb4, 0x8b, 0xc3,
    0xf0, 0xe7, 0x97, 0xd2, 0x4b, 0x96, 0xd6, 0x6b, 0xed, 0x37, 0x8d, 0xa8, 0xdd, 0x5e, 0x29, 0x30,
    0xc2, 0x46, 0x47, 0x52, 0x4c, 0xae, 0xed, 0x5b, 0xa9, 0x40, 0x43, 0x8c, 0xf0, 0x22, 0x41, 0x37,
    0xee, 0x5b, 0x1b, 0x24, 0xe2, 0xec, 0x77, 0x57, 0xfe, 0x5f, 0xc1, 0x69, 0x37, 0xd0, 0xe4, 0xec,
    0xcf, 0x46, 0x98, 0x0f, 0xf6, 0xb0, 0x6d, 0xa7, 0xb6, 0x1d, 0x51, 0xc0, 0xb8, 0x0c, 0x75, 0x2e,
    0x2a, 0x08, 0xda, 0x5c, 0xe4, 0x1c, 0x12, 0x89, 0x33, 0xf5, 0x8c, 0xa5, 0xe6, 0xb2, 0x1e, 0xed,
    0x71, 0x7b, 0x60, 0x50, 0x6b, 0xfb, 0xc9, 0xb7, 0x35, 0x68, 0x7b, 0xff, 0xd8, 0xa2, 0x6e, 0x59,
    0x6a, 0xea, 0x29, 0x98, 0x31, 0xd8, 0xb2, 0x9e, 0x9f, 0x12, 0xe3, 0xcd, 0x81, 0xbf, 0xbc, 0x1b,
    0xd7, 0x44, 0x8c, 0x4f, 0x34, 0x57, 0x20, 0x52, 0xb5, 0xd7, 0x14, 0xc6, 0xd0, 0xa1, 0xa8, 0x98,
    0xae, 0x66, 0xa9, 0x84, 0x93, 0x2c, 0x2c, 0xc2, 0xd6, 0xed, 0x68, 0x66, 0x7f, 0x3a, 0x43, 0x1c,
    0x8d, 0xf4, 0x10, 0x04, 0x9d, 0xe3, 0x91, 0x57, 0x9d, 0x15, 0xe0, 0x30, 0xbc, 0x76, 0xba, 0xa6,
    0x70, 0xde, 0x61, 0xeb, 0xa5, 0x0e, 0x64, 0xae, 0xdf, 0x03, 0x06, 0xaf, 0x88, 0xde, 0x3b, 0x8b,
    0x9f, 0xd2, 0x60, 0x4b, 0x87, 0x03, 0xbe, 0xce, 0xea, 0x44, 0xdd, 0xea, 0xe0, 0xd0, 0x85, 0x90,
    0xb7, 0x55, 0xac, 0x06, 0xfa, 0x74, 0x47, 0x84, 0x70, 0xca, 0xaf, 0xba, 0xb1, 0xe9, 0x65, 0x4b,
    0x64, 0x10, 0xba, 0x14, 0x20, 0x7c, 0x4f, 0x23, 0x11, 0xc1, 0x5f, 0x63, 0xad, 0x6d, 0xcd, 0x32,
    0x07, 0x25, 0xd7, 0x05, 0x82, 0x06, 0x63, 0x5b, 0xd2, 0xbc, 0xc5, 0x20, 0xc5, 0x78, 0x8a, 0x03,
    0x3a, 0x95, 0x53, 0x30, 0x35, 0x56, 0x01, 0x83, 0x63, 0x46, 0x63, 0x85, 0x5e, 0x1f, 0x25, 0x25,
    0x87, 0xe9, 0x41, 0xcd, 0x69, 0x24, 0x0a, 0x85, 0x47, 0x8f, 0xc7, 0xca, 0x83, 0xef, 0x30, 0xa5,
    0x94, 0xfb, 0x1b, 0x16, 0xa5, 0xde, 0xe5, 0x96, 0x14, 0xe7, 0xd5, 0x71, 0xf0, 0x72, 0xe0, 0xca,
    0x34, 0xb8, 0x2b, 0xbc, 0xaf, 0x53, 0x16, 0xcd, 0xab, 0x0a, 0xd0, 0xd1, 0x6a, 0x02, 0x28, 0x4c,
    0x3b, 0x40, 0x29, 0x96, 0x17, 0x45, 0x14, 0xa5, 0x0e, 0xee, 0xa4, 0x9f, 0xf6, 0x0b, 0x68, 0x60,
    0xf7, 0x0d, 0x5b, 0x7b, 0xbe, 0x8f, 0x18, 0x54, 0x52, 0xe4, 0x39, 0x7e, 0x43, 0x95, 0x0e, 0x48,
    0x1b, 0xf8, 0xe0, 0x05, 0x5d, 0xb6, 0x07, 0x8c, 0x8a, 0xdb, 0x4b, 0x72, 0xa0, 0xb7, 0xfd, 0xfb,
    0x25, 0xfe, 0xef, 0xec, 0x82, 0xb4, 0xd6, 0xa7, 0xa4, 0xb2, 0x0b, 0xb6, 0x17, 0xd5, 0xf3, 0x9d,
    0xa7, 0x41, 0xdc, 0xcd, 0xf5, 0xb9, 0x5f, 0xec, 0x25, 0xcd, 0xea, 0xdb, 0x07, 0x3e, 0x78, 0x14,
    0xf6, 0x37, 0x62, 0xb5, 0xd8, 0xca, 0x34, 0xbf, 0x77, 0x0d, 0xb2, 0xed, 0xa4, 0x0e, 0x6c, 0xd0,
    0xae, 0xef, 0xcb, 0xcb, 0x83, 0x79, 0xd6, 0xdd, 0x85, 0x7d, 0xde, 0x7d, 0x21, 0x98, 0x46, 0x4f,
    0xc9, 0xc9, 0x3f, 0xa5, 0x00, 0x6e, 0xcb, 0xdf, 0x15, 0x74, 0x34, 0xb0, 0x4f, 0xc0, 0xb4, 0xaf,
    0xea, 0xae, 0xc9, 0x1e, 0xa9, 0x97, 0x68, 0x08, 0xc0, 0x69, 0x03, 0xc6, 0x72, 0x14, 0x81, 0x52,
    0xd9, 0x07, 0x93, 0x21, 0xa6, 0x55, 0x6d, 0x39, 0xcf, 0xc1, 0xec, 0xca, 0xa1, 0xda, 0x27, 0xe7,
    0x5d, 0xc4, 0x01, 0x42, 0x6f, 0x46, 0x14, 0xf2, 0x22, 0x1f, 0x3e, 0x10, 0x9b, 0x03, 0xca, 0xbb,
    0xb1, 0xa2, 0xcd, 0x58, 0xe8, 0xaa, 0xa4, 0x4b, 0x41, 0x7e, 0x32, 0x67, 0x45, 0xbb, 0x0b, 0x4f,
    0x59, 0x40, 0xdd, 0xbf, 0xdb, 0xb3, 0x01, 0x4e, 0xf2, 0x7b, 0xd4, 0xf2, 0x36, 0x92, 0x05, 0x0c,
    0x69, 0xfa, 0x3b, 0xba, 0x36, 0x62, 0xd2, 0x63, 0x0f, 0x5d, 0xa6, 0x47, 0xd2, 0x26, 0xd5, 0xa4,
    0xae, 0xf0, 0xc3, 0x3d, 0x83, 0x94, 0xb7, 0xe5, 0x07, 0x47, 0xed, 0xa7, 0x6e, 0x8d, 0xc5, 0xb4,
    0x60, 0x89, 0xe3, 0x96, 0x51, 0xb4, 0xe8, 0x45, 0x7a, 0x18, 0x99, 0xae, 0x3f, 0x70, 0x0e, 0xfa,
    0x90, 0xbf, 0xf3, 0xed, 0x09, 0xa3, 0xd6, 0xc0, 0xa3, 0xbc, 0x38, 0x8d, 0x85, 0xc4, 0x02, 0xe3,
    0xbf, 0x46, 0x24, 0x08, 0xe0, 0x43, 0x66, 0x41, 0x83, 0xa4, 0x9e, 0x2f, 0xde, 0x7e, 0x07, 0xb1,
    0x49, 0xf9, 0x61, 0x8b, 0xce, 0xd4, 0x34, 0xa5, 0x99, 0x4d, 0x2c, 0xbe, 0x5c, 0x26, 0x62, 0x3b,
    0xbc, 0x3f, 0x24, 0xa4, 0x66, 0x72, 0x9a, 0x4c, 0xca, 0xb1, 0x6a, 0xad, 0x01, 0x3e, 0x3a, 0xe7,
    0x80, 0x5a, 0x81, 0x2d, 0x50, 0x51, 0x60, 0xae, 0xfd, 0xf3, 0x31, 0x64, 0xe9, 0x20, 0xc2, 0xc9,
    0x41, 0x8b, 0x45, 0x93, 0x2a, 0x96, 0x3d, 0x75, 0xd0, 0xf9, 0x34, 0x84, 0x70, 0xcd, 0xde, 0x88,
    0x64, 0xaf, 0x15, 0x5a, 0x67, 0x5a, 0x36, 0xbb, 0x83, 0x58, 0xfb, 0x7e, 0x56, 0x21, 0x0f, 0x4f,
    0xbe, 0xb0, 0x97, 0xb2, 0xc9, 0x34, 0x0a, 0x23, 0x8b, 0xa7, 0x75, 0x63, 0xc9, 0xad, 0x2e, 0x6a,
    0xcb, 0xbb, 0x07, 0x32, 0xb6, 0xa3, 0xf9, 0x60, 0xaa, 0x8a, 0x99, 0xda, 0x14, 0x14, 0x47, 0x88,
    0x69, 0x92, 0x64, 0x19, 0xec, 0x46, 0x60, 0xbc, 0x28, 0xf3, 0x19, 0xe4, 0x11, 0x44, 0xd7, 0x9d,
    0xb1, 0x61, 0x7f, 0x59, 0x59, 0xe6, 0xbe, 0x75, 0x05, 0x34, 0x55, 0xc7, 0xd1, 0x86, 0xa1, 0x03,
    0x68, 0x8c, 0x66, 0x62, 0x37, 0xee, 0x1d, 0xd5, 0xe1, 0xbd, 0x2e, 0xed, 0xfa, 0xf4, 0x26, 0xd5,
    0x40, 0x72, 0xd8, 0xa1, 0x39, 0x99, 0x5e, 0xb9, 0xd7, 0xa2, 0x0b, 0x5d, 0x1a, 0x6c, 0x2c, 0xa5,
    0x83, 0x7f, 0x25, 0x30, 0x29, 0x2f, 0xe5, 0xf7, 0xfd, 0x50, 0xb9, 0x34, 0x29, 0xc4, 0x85, 0x3b,
    0x3e, 0x61, 0x0f, 0x0c, 0xaf, 0x4a, 0x41, 0x3f, 0xe1, 0x6d, 0xb0, 0x27, 0xa5, 0xd4, 0x10, 0x28,
    0x7e, 0x52, 0xc3, 0x1d, 0xcf, 0x3e, 0x0b, 0xd3, 0x04, 0xc7, 0x0c, 0x62, 0xef, 0x22, 0xcd, 0x1b,
    0x4f, 0x4b, 0x30, 0xc6, 0xc2, 0x38, 0xb3, 0x35, 0x72, 0x8f, 0xb1, 0xb2, 0x68, 0xf8, 0x48, 0x4e,
    0xe9, 0xa8, 0x23, 0x6d, 0xd9, 0x32, 0x65, 0x58, 0x32, 0xae, 0xe5, 0x89, 0xb8, 0xd3, 0x3e, 0x2d,
    0x32, 0xd6, 0x59, 0x96, 0x07, 0x07, 0xbe, 0x42, 0xe8, 0x67, 0x3a, 0x6e, 0xa5, 0x69, 0x05, 0xe9
      }
    };

    if( !fd_lthash_equal( &lthash_out, &expected_hash ) ) {
      FD_LOG_ERR(( "Test case 4 failed: hash mismatch" ));
    }

    /* Also verify that executable field is properly masked to 1 bit */
    fd_account_meta_t account_with_1;
    account_with_1.lamports = 3000UL;
    account_with_1.executable = 1;
    memset( account_with_1.owner, 0x88, FD_PUBKEY_FOOTPRINT );
    account_with_1.dlen = 25UL;

    fd_lthash_value_t lthash_with_executable_1;
    fd_hashes_account_lthash( &pubkey, &account_with_1, data, &lthash_with_executable_1 );

    /* Should produce same hash as with executable=255 since both are masked to 1 */
    FD_TEST( fd_lthash_equal( &lthash_out, &lthash_with_executable_1 ) );
  }

  FD_LOG_NOTICE(( "test_fd_hashes_account_lthash passed" ));
}

static void
test_fd_hashes_hash_bank( void ) {
  FD_LOG_NOTICE(( "Testing fd_hashes_hash_bank" ));

  /* Test case: Bank hash computation */
  {
    fd_lthash_value_t lthash;
    memset( lthash.bytes, 0xAA, FD_LTHASH_LEN_BYTES );

    fd_hash_t prev_bank_hash;
    memset( prev_bank_hash.hash, 0xBB, sizeof(fd_hash_t) );

    fd_hash_t last_blockhash;
    memset( last_blockhash.hash, 0xCC, sizeof(fd_hash_t) );

    ulong signature_count = 12345UL;

    fd_hash_t hash_out;
    fd_hashes_hash_bank( &lthash, &prev_bank_hash, &last_blockhash, signature_count, &hash_out );

    /* Check that the hash matches the expected hash */
    fd_hash_t expected_hash = {
      .uc = {
        0x87, 0x8a, 0xc3, 0xbe, 0xd7, 0x48, 0x97, 0x6c, 0xbd, 0x14, 0xf2, 0xac, 0x9a, 0x37, 0xdd, 0xb5,
    0x77, 0xb1, 0x69, 0x0c, 0x6b, 0x8c, 0xce, 0x93, 0x68, 0x79, 0x58, 0x43, 0x86, 0x37, 0x42, 0xee
      }
    };

    if( !fd_hash_equal( &expected_hash, &hash_out ) ) {
      FD_LOG_ERR(( "test_fd_hashes_hash_bank failed: bank hash mismatch" ));
    }
  }

  FD_LOG_NOTICE(( "test_fd_hashes_hash_bank passed" ));
}

/* Define global test data */
static fd_account_meta_t test_meta;
static uchar test_data[64];

static void
test_fd_hashes_update_lthash( void ) {
  FD_LOG_NOTICE(( "Testing fd_hashes_update_lthash" ));

  /* Test the lthash update logic without a real bank structure */

  /* Create test data */
  fd_pubkey_t pubkey;
  memset( &pubkey, 0x22, sizeof(fd_pubkey_t) );

  test_meta.lamports = 5000UL;
  test_meta.executable = 0;
  memset( test_meta.owner, 0x33, FD_PUBKEY_FOOTPRINT );
  test_meta.dlen = 64UL;

  memset( test_data, 0x44, 64 );

  /* Initialize a bank lthash */
  fd_lthash_value_t bank_lthash;
  memset( bank_lthash.bytes, 0x11, FD_LTHASH_LEN_BYTES );

  /* Calculate previous account hash */
  fd_lthash_value_t prev_hash;
  memset( prev_hash.bytes, 0x55, FD_LTHASH_LEN_BYTES );

  /* Store initial bank lthash */
  fd_lthash_value_t initial_lthash;
  memcpy( &initial_lthash, &bank_lthash, sizeof(fd_lthash_value_t) );

  /* Simulate what fd_hashes_update_lthash does */

  /* Subtract the old hash */
  fd_lthash_sub( &bank_lthash, &prev_hash );

  /* Calculate new hash */
  fd_lthash_value_t new_hash;
  fd_hashes_account_lthash( &pubkey, &test_meta, test_data, &new_hash );

  /* Add new hash */
  fd_lthash_add( &bank_lthash, &new_hash );

  /* Verify the result is correct */
  fd_lthash_value_t expected_lthash;
  memcpy( &expected_lthash, &initial_lthash, sizeof(fd_lthash_value_t) );
  fd_lthash_sub( &expected_lthash, &prev_hash );
  fd_lthash_add( &expected_lthash, &new_hash );

  FD_TEST( fd_lthash_equal( &bank_lthash, &expected_lthash ) );

  /* Test with zero previous hash (new account) */
  fd_lthash_value_t zero_prev;
  fd_lthash_zero( &zero_prev );

  memcpy( &bank_lthash, &initial_lthash, sizeof(fd_lthash_value_t) );
  fd_lthash_sub( &bank_lthash, &zero_prev );  /* Should be no-op */
  fd_lthash_add( &bank_lthash, &new_hash );

  memcpy( &expected_lthash, &initial_lthash, sizeof(fd_lthash_value_t) );
  fd_lthash_add( &expected_lthash, &new_hash );

  FD_TEST( fd_lthash_equal( &bank_lthash, &expected_lthash ) );

  FD_LOG_NOTICE(( "test_fd_hashes_update_lthash passed" ));
}

int
main( int     argc,
      char ** argv ) {
  fd_boot( &argc, &argv );

  test_fd_hashes_account_lthash();
  test_fd_hashes_hash_bank();
  test_fd_hashes_update_lthash();

  FD_LOG_NOTICE(( "pass" ));
  fd_halt();
  return 0;
}
